<!DOCTYPE html>
<html lang="zh-cmn-Hans">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<title>鹿程智慧油站商户平台</title>
		<meta name="description" content="鹿程科技是提供加油站互联网化零管系统、营销及支付和大数据分析运营服务的行业领先科技公司。鹿程科技充分了解加油站行业的需求和新兴互联网的发展,依靠业内最先进的科技和标准化的运营,持续帮助油站业务发展创造价值。"/>
		<meta name="keywords" content="智慧油站,鹿程,鹿程智慧油站,鹿程智慧油站微信支付,加油站微信支付,加油站营销管理"/>
		<link rel="icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link rel="shortcut icon" href="https://static.zhihuiyouzhan.com.cn/static/styles/admin/img/title.ico" type="image/x-icon">
		<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../layui/css/layui.css" />
		<link rel="stylesheet" href="../css/style.css" />
	</head>
<body>
	<section class="section-right">
		<!--deer-tit-->
		<div class="deer-tit">
			<h3>导入数据</h3>
			<h4>数据导入</h4>
		</div>
		<!--/deer-tit-->
		<!--deer-content-->
		<div class="deer-content">
			<div class="order-nav clearfix layui-form">
				<dl>
					<input type="text" name="phone" placeholder="用户手机号" lay-verify="required|phone" lay-verType="tips" class="layui-input" />
				</dl>
				<dl style="width: 320px"><input id="time" name="time" lay-verify="required" placeholder="导入时间" class="layui-input"lay-key="1"></dl>
            	<div class="order-nav-search">
            		<dl class="deer-btn" lay-submit lay-filter="*" >添加</dl>
            		<dl class="deer-btn" id="leading">数据导入</dl>
            	</div>
            	
			</div>
			<section class="order-table">
				<table class="layui-table" lay-skin="line">
				  <thead>
				    <tr>
				      	<th>姓名</th>
				      	<th>手机号</th>
				    	<th>成长值</th>
				     	<th>积分</th>
				      	<th>IC卡号</th>
				      	<th>导入时间</th>
				      	<th>绑定时间</th>
				      	<th>操作</th>
				    </tr> 
				  </thead>
				  <tbody>
				    <tr>
				    	<td>13013522330</td>
				    	<td>13013522330</td>
				    	<td>0</td>
				    	<td>400</td>
				    	<td>895938</td>
				    	<td>2017-10-28</td>
				    	<td>未绑定</td>
				    	<td><button class="deer-btn-del" data-id="131053917891Ac5">删除</button></td>
				    </tr>
				    <tr>
				    	<td>13013522330</td>
				    	<td>13013522330</td>
				    	<td>0</td>
				    	<td>400</td>
				    	<td>895938</td>
				    	<td>2017-10-28</td>
				    	<td>未绑定</td>
				    	<td><button class="deer-btn-del" data-id="131053917891A4E">删除</button></td>
				    </tr>
				    <tr>
				    	<td>13013522330</td>
				    	<td>13013522330</td>
				    	<td>0</td>
				    	<td>400</td>
				    	<td>895938</td>
				    	<td>2017-10-28</td>
				    	<td>未绑定</td>
				    	<td><button class="deer-btn-del" data-id="131053917891AcD">删除</button></td>
				    </tr>
				  </tbody>
				</table>
					
					<div class="order-table-footer clearfix">
						<div class="order-table-page">
							<div id="demo3">
								
							</div>
						</div>
					</div>
				</section>
		</div>
		<!--deer-content-->
	</section>
	
	
	
	
	
	
	<!--js-->
	<aside>
		<script type="text/javascript" src="../layui/layui.js" ></script>
		<script type="text/javascript">
			layui.use(['form','laydate','jquery','layer','upload','laypage'], function(){
			  	var form = layui.form;
			  	var laydate=layui.laydata;
			  	var laypage=layui.laypage;
			  	var upload=layui.upload;
			  	var layer=layui.layer;
			  	var $=layui.jquery;
			  	
			  	//选择日期
			  	laydate=layui.laydate;
					laydate.render({
			        elem: '#time' //指定元素
			        ,type:'datetime'
			        ,range: '/'
			    })
				//删除	
				$('.deer-btn-del').bind('click',function(){
			    	layer.confirm('您确定刪除吗？', {
						  btn: ['取消','确定'] //按钮
						}, function(){
						 	layer.msg('您取消了操作', {icon:2});
						}, function(){
							var phoneNo = $(this).data('id');
					          	path = "/index.php/merchant/dump/del.html?no=" + phoneNo;
					            $('.deer-btn-del').attr('href', path);
							layer.msg('删除成功', {icon: 1});
					})
			    })
				
				laypage.render({
				    elem: 'demo3'
				    ,count: 1000//data.length
				    ,theme: '#00cc9a'
			    	,prev: '«'
			    	,next: '»'
			  	})
				//表单验证
			    form.on('submit(*)', function(data){
			    	
				  	console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
				 	return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
				});
			    
			    //导入数据
			    $("#leading").on('click', function () {
			        layer.open({
			            type: 1,
			            area: ['460px', '280px'],
			            title: '导入数据',
			            shade: 0.6,//遮罩透明度
			            anim: 0,//0-6的动画形式，-1不开启
			            shadeClose: true, //点击遮罩关闭
			            content: '<div class="buyer-upload">'
							+'<p><button class="layui-btn layui-btn-normal" id="test">选择文件</button></p>'
							+'<p><a href="../img/example.xlsx" download class="layui-btn layui-btn-warm">下载示例</a><code>A:手机号;B:积分;C:成长值;D:IC卡号;E:用户名</code></p>'
							+'<div class="buyer-upload-enter"><p><button type="button" class="deer-btns layui-btn layui-layer-close" id="textno">取消上传</button>'
							   +'<button type="button" class="deer-btn layui-btn" id="testup">开始上传</button></p></div>'
							+'</div>'
			        })
			        //上传按钮初始化
			        upload.render({
					    elem: '#test'
					    ,url: '/upload/'
					    ,auto: false
					    ,bindAction: '#testup'
					    ,accept:'file'
					    ,exts:'xlsx|xls'
					    ,size:0
					    ,done: function(res){
					      console.log(res)
				   	}
		      		})
			        
				    //判断是否选择文件
				    $('#testup').bind('click',function(){
				    	if($('.buyer-upload>p>span').hasClass('layui-inline')){
				    		return false
				    	}else{
				    		layer.msg('您尚未选择任何文件，', {icon: 2});
				    	}
			   		})
				}) 
				
			})
			</script>
		</script>
	</aside>
	<!--js-->
	
	
	
</body>
</html>